package com.wangzhen.spring.ioc.dependcy.entity;

import com.wangzhen.spring.ioc.dependcy.constants.CityEnum;
import org.springframework.core.io.Resource;

import java.util.Arrays;

/**
 * @author dell
 * @since 2020/9/18 12:41
 */
public class User {
    private String name;
    private Integer age;
    private Company company;
    /**
     * 注入枚举类型
     */
    private CityEnum cityEnum;

    private CityEnum[] cityEnums;

    private Resource resource;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public static User createUser(){
        User user = new User();
        user.setName("Lucy");
        user.setAge(30);
        return user;
    }

    public CityEnum getCityEnum() {
        return cityEnum;
    }

    public void setCityEnum(CityEnum cityEnum) {
        this.cityEnum = cityEnum;
    }

    public Resource getResource() {
        return resource;
    }

    public void setResource(Resource resource) {
        this.resource = resource;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", company=" + company +
                ", cityEnum=" + cityEnum +
                ", cityEnums=" + Arrays.toString(cityEnums) +
                ", resource=" + resource +
                '}';
    }

    public CityEnum[] getCityEnums() {
        return cityEnums;
    }

    public void setCityEnums(CityEnum[] cityEnums) {
        this.cityEnums = cityEnums;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }
}
